UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SuXlmiKNOq4yQeZjQm++oUYgKMqNIVJA6OqZiKndGbM=' 
WHERE 
  key_id = 'c327185f544ab4e5fd3130cb44c6bdfe68f29694ab91d805d1f4f7ee2f0218df' 
  AND (
    token = 'SuXlmiKNOq4yQeZjQm++oUYgKMqNIVJA6OqZiKndGbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015