UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aXR3fV2j4EL0W8TPRvVyDkWfXhCo6o5KpMH0L03n19c=' 
WHERE 
  key_id = '584b7fd9e917d5071cbf5fc110721ae6daa37d1dddc599fb31e9fffa9041e5b7' 
  AND (
    token = 'aXR3fV2j4EL0W8TPRvVyDkWfXhCo6o5KpMH0L03n19c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036