UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/bRyEHD4YNNXoHM/w3hKCzqX01AX9XrmhzqvOeecxjw='
WHERE
key_id = '79f4e3cc46f80d7b6564ac38a201cd09e39b3201a9836dca919b038c80d08ecb'
AND (
token = '/bRyEHD4YNNXoHM/w3hKCzqX01AX9XrmhzqvOeecxjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)