UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qU8G289f0PyyW8SjmvqsI+OU6x0zg94O1ddmns7fx04=' 
WHERE 
  key_id = '57392b4d1d40ebe3c8f31745269f0a4d5086bbf62420fcf56f1c360f77ee9784' 
  AND (
    token = 'qU8G289f0PyyW8SjmvqsI+OU6x0zg94O1ddmns7fx04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00291