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