UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dgQf1RsPQj+iBJqo1ap0F6Mawpuh0YxtH4tuipc2W5s='
WHERE
key_id = '2b8cadbe7e5da6ef00e9915f6bdb42eef32072fc1655830635b905f718477f48'
AND (
token = 'dgQf1RsPQj+iBJqo1ap0F6Mawpuh0YxtH4tuipc2W5s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)