UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kNxr9g8kf3OXOnMbzPFxb1ClR9hcllF3A2YYEax7KT0=' 
WHERE 
  key_id = 'e6d8d2b3d6d0576cf2cdd7bd9264f93cb6dc6af9c5623014794304e3a1679ba5' 
  AND (
    token = 'kNxr9g8kf3OXOnMbzPFxb1ClR9hcllF3A2YYEax7KT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047