UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UZ++rofQkoqgzhTwqQbXu/fM2LMMMhKgiUW0Lo24+GQ=' 
WHERE 
  key_id = '1aadb4490293588a2cd2d457946f9efe772e58ce378ade8affc0b34d5070dc78' 
  AND (
    token = 'UZ++rofQkoqgzhTwqQbXu/fM2LMMMhKgiUW0Lo24+GQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034