UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ifrPwEO0fu4L3fQbad+70+yx4+IKTyCVrQ1YP/me8E='
WHERE
key_id = 'db964d7eed3a8fe3f86ab0fce519a0828f10176223ebb7330caf27f0081fa249'
AND (
token = '1ifrPwEO0fu4L3fQbad+70+yx4+IKTyCVrQ1YP/me8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)