UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wvzJtCAMklIqr3eyQ5fqTLuxhiBwK4jzSppVpx3wp0s=' 
WHERE 
  key_id = 'dec5ce2fae813d8259771e14397e6ce4c2eb2cdb6c48e2fc87f1cafcdb456b61' 
  AND (
    token = 'wvzJtCAMklIqr3eyQ5fqTLuxhiBwK4jzSppVpx3wp0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036