UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lavWBq8Hc/voFUdvWSCflbR1n/z6exrkeYTGgqzYm+o='
WHERE
key_id = '152d5cdfafbf31b561693db8e096ce0c06eea0d1947cef5bb166ab54d87237f3'
AND (
token = 'lavWBq8Hc/voFUdvWSCflbR1n/z6exrkeYTGgqzYm+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)