UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oh/wPIP9ONgHSLPJYnolJbJnQiHjf4/ZqgHrw86kV24=' 
WHERE 
  key_id = '1b96f8dbfe96be2094e54d827cf91128e78d2e409967efb3a9ef4b5b749d6bf5' 
  AND (
    token = 'oh/wPIP9ONgHSLPJYnolJbJnQiHjf4/ZqgHrw86kV24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032