UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3frz/np+IsQsmtlpgq1yaznX+eFByTqav8H22du2gOg='
WHERE
key_id = 'bd6d411f0c0fe4753bc3edda34f8bef7783af564697917a1ba926da96b96ac92'
AND (
token = '3frz/np+IsQsmtlpgq1yaznX+eFByTqav8H22du2gOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)