UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2LJjdJ8FQXAkruMgxLg54ifusL6oPj4NN+UasV/OgiQ='
WHERE
key_id = '1a51b7d7f81b42e02fa3936be845764e460eab8938068ed727ac934120773cb9'
AND (
token = '2LJjdJ8FQXAkruMgxLg54ifusL6oPj4NN+UasV/OgiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)