UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UfeDWL6Z1/8Mlv+ibT9IEdhviT76fi2NAt5qCxNDJ6I=' 
WHERE 
  key_id = 'c19f0bcda32fb236e2e631ba7b79f6ca601c4d5668cac27d951335a4c953b86f' 
  AND (
    token = 'UfeDWL6Z1/8Mlv+ibT9IEdhviT76fi2NAt5qCxNDJ6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034