UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k3vwPeatOYHonM5bt1GUjMDNsjGSBQrozBwY23fr1B4=' 
WHERE 
  key_id = '666e4f312faee31b4f610dd21eaf2bebcf06532a1ae7d2e78d5e9c18187c8850' 
  AND (
    token = 'k3vwPeatOYHonM5bt1GUjMDNsjGSBQrozBwY23fr1B4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078