UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '41qR12CD8Hqwj3U/tasBwQVn2VytthbLME1dN4XseTc='
WHERE
key_id = 'd623b984e4426f1fdbc3351e9fdb89e0860e959b93e1bfea5237d86ac42fa515'
AND (
token = '41qR12CD8Hqwj3U/tasBwQVn2VytthbLME1dN4XseTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)