UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mznrfcdjIYIvGHLxSs0EwmN9jLmXcF+hkwZk6/MEesw=' 
WHERE 
  key_id = '4541ef1e94ccd0d1fa7f2246ccb088649fb6c8c5eb805fe5ec100eec66b49ed6' 
  AND (
    token = 'mznrfcdjIYIvGHLxSs0EwmN9jLmXcF+hkwZk6/MEesw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029