UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OXaEXZzPEMtO/nOYlDPe2bKLBnR4YMgYF7AieYBjRDc=' 
WHERE 
  key_id = '6fc406cc42908073fc41cadfd9b54f527d04015b16ae046d73e557be9dbe3720' 
  AND (
    token = 'OXaEXZzPEMtO/nOYlDPe2bKLBnR4YMgYF7AieYBjRDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046