UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+JCzBSxvYxh21p8LaUl/B215fB50yxh9AOPfHndgvxk='
WHERE
key_id = '139e24dea34f76a4aea6dcfcf92db30e6b0de3add70ab6b5ac72a345e2994f33'
AND (
token = '+JCzBSxvYxh21p8LaUl/B215fB50yxh9AOPfHndgvxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)