UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '452mj1SqbuWy/qddpeIWGzyPdJZidov34l2F5el3FyA='
WHERE
key_id = '8879a371d5421f9203cbb144d652ede13c504015a96b8adfe0a46c37bd75166b'
AND (
token = '452mj1SqbuWy/qddpeIWGzyPdJZidov34l2F5el3FyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)