UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YobwhHhPSezO3X6wy3FoDaZKe9y+Ig2uTvP3VXjLKk8=' 
WHERE 
  key_id = 'f06de2c40e29784cd712e794d2a7bf0f1f210e4148ebd8a2a39597ab312d660b' 
  AND (
    token = 'YobwhHhPSezO3X6wy3FoDaZKe9y+Ig2uTvP3VXjLKk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030