UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ABZ1grV24TBJp3l/KRAeMaJM3NxyLpCS5FKTQuVd1I=' 
WHERE 
  key_id = '75faee48bd0f125dc9d5be26e3598dfc4eb3b7738ea33fe1c9417db033fa0769' 
  AND (
    token = '9ABZ1grV24TBJp3l/KRAeMaJM3NxyLpCS5FKTQuVd1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030