UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q1X2JSp4+xu5jllkopkrooHJkgZFpexkJ81rofuTkJQ='
WHERE
key_id = '2e1cab9895fc2fa67f1dec66696596c20dd87ccfcdb74fea3be016a55ef657d5'
AND (
token = 'Q1X2JSp4+xu5jllkopkrooHJkgZFpexkJ81rofuTkJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)