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