UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PoufC8CYkpG3w9QIVmFT/dKCFGKIPjtM0ZnXYh/YmA8=' 
WHERE 
  key_id = 'dbde23543ed5d21fa960fc0664486fbcba6851a6d871b76bd228e68d3aca1944' 
  AND (
    token = 'PoufC8CYkpG3w9QIVmFT/dKCFGKIPjtM0ZnXYh/YmA8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052