UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hiDBnGhr350e/kyAk5so1tjZTehptYzeycql9O+chVw='
WHERE
key_id = '46ca69e1c7b30a611d94cd00e3bffdfd271d3c633fc6b08426a4456aa5be56a8'
AND (
token = 'hiDBnGhr350e/kyAk5so1tjZTehptYzeycql9O+chVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)