UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2N6b8bT/Pfsrx7NR5KP8ak/unt9ErpNDPQsvOr3SocA='
WHERE
key_id = '24d87cfa0223f7577ff9a1bb50db4114a56ea79a6a696056426664e66293e05f'
AND (
token = '2N6b8bT/Pfsrx7NR5KP8ak/unt9ErpNDPQsvOr3SocA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)