UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RcQToPx8OjHVHYexMiBgF49qXBaMTNQSSnG0B71LLtk='
WHERE
key_id = '4690fab2dd03eb366cb57169cd7ca5b701f7928c17685a3663e968e3ac80390b'
AND (
token = 'RcQToPx8OjHVHYexMiBgF49qXBaMTNQSSnG0B71LLtk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)