UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9k4pV4YR9f3yRl7MEcWjoRYaG/r6QKwTbS2yX1ii7/o='
WHERE
key_id = '7fb20f241cc016eecf672a144dac53bc1203d711ffe2651cdc87c0946e498943'
AND (
token = '9k4pV4YR9f3yRl7MEcWjoRYaG/r6QKwTbS2yX1ii7/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)