UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XIBgXcHw6lxx4DIhTgkUuJNTJv/H/pvxfRcSTbi+dfc='
WHERE
key_id = '4340353926a60405112610c72a2713339dedf3ebebc8cfd75f975c888de81a3b'
AND (
token = 'XIBgXcHw6lxx4DIhTgkUuJNTJv/H/pvxfRcSTbi+dfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)