UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uQ+22JdPf6LuUCuiR0z4dI1SwF7HHczIIcGsvvvk0Sk='
WHERE
key_id = '67f8f3c4be9e3a9e0b99e045546ff27d5f228cabbe4f12f5eb30cce1dfc15820'
AND (
token = 'uQ+22JdPf6LuUCuiR0z4dI1SwF7HHczIIcGsvvvk0Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)