UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V4az87k7iauF0Tg1/HZFOjA8KIm7iSpNoRgs2dg3AW4='
WHERE
key_id = 'bb445f0ce0a5e11a2ee03e126bc4fd309515f519474976a84d2fd9a636ffa7a2'
AND (
token = 'V4az87k7iauF0Tg1/HZFOjA8KIm7iSpNoRgs2dg3AW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)