UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZqJbTEylB2pAnxiTxQ2vBTE1sm3h2E2ohi8wczb/36k='
WHERE
key_id = '7c2d7570e44f65d4cd4b649637c897648a0bf55f575e5b83dd0c88efcf4848f0'
AND (
token = 'ZqJbTEylB2pAnxiTxQ2vBTE1sm3h2E2ohi8wczb/36k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)