UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZrJWT+Okn3V9wxbJhhq+FLj5OSuchmcn/fsmLA2R0PY='
WHERE
key_id = '1712d50556b3999782c120582c01db970b6f032e73b4a4ff1b6f504f291cb149'
AND (
token = 'ZrJWT+Okn3V9wxbJhhq+FLj5OSuchmcn/fsmLA2R0PY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)