UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LdM4TMIVujal3gwxOWqWf6AobS5/6L3FcNJcYl7eyyM='
WHERE
key_id = '472f716ab11d24a0d2f98bbe8b2272fd2f9f51784d6d589f8cece1ef37ae6e36'
AND (
token = 'LdM4TMIVujal3gwxOWqWf6AobS5/6L3FcNJcYl7eyyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)