UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R8/WeSkANWTAL/XEQezA+YTCzCFilrfh5kkFcEXWiqg=' 
WHERE 
  key_id = 'e02420d4cf5c7bda2bf0e4ddad3f0e597c98546940fbebd1080206fa63cd31a4' 
  AND (
    token = 'R8/WeSkANWTAL/XEQezA+YTCzCFilrfh5kkFcEXWiqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048