UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'stlzKkvs3S6v/PaBTfYcbuQSTGzJqbKLwsFjq511Peo=' 
WHERE 
  key_id = '8e32983b708477a1ab2523f4f72a7d9067ea19a1e7d44a0f17e7c7e60bbf3529' 
  AND (
    token = 'stlzKkvs3S6v/PaBTfYcbuQSTGzJqbKLwsFjq511Peo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045