UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7wjCKcMYoSIbvSF82Q4hcqL1MjoBjR44+sDy3jmBhmw='
WHERE
key_id = '5698a0c728767d07393c77085dbe0da43c96be74c669ac1804e2c4d574c615ac'
AND (
token = '7wjCKcMYoSIbvSF82Q4hcqL1MjoBjR44+sDy3jmBhmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)