UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gdxWBDDeanYfNCbheRW2iY/wQA4zhSHzH2Nbo/uuIQM='
WHERE
key_id = '2ad7c37dfd12ec88297c277ea9751641bd263fe813bc554213e418759a4f7f36'
AND (
token = 'gdxWBDDeanYfNCbheRW2iY/wQA4zhSHzH2Nbo/uuIQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)