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

Query time 0.00031