UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vLg9aU1RfjUqJ4Wuv7rdXpEShntrQuJMMqgSibZ4Ngo=' 
WHERE 
  key_id = '24ec3c2245e2cca6f894af9516f063a697c1b19b3e8979970811f413766a86f4' 
  AND (
    token = 'vLg9aU1RfjUqJ4Wuv7rdXpEShntrQuJMMqgSibZ4Ngo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038