UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pfXuCba90mYdmPrf2sF/fM4JUMzSGLVro5A1wq4PfwU='
WHERE
key_id = '26414b826fc955d5100f87a425b96fa06b75a36d8d1a82f778925aba17965885'
AND (
token = 'pfXuCba90mYdmPrf2sF/fM4JUMzSGLVro5A1wq4PfwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)