UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axJsP3g96FMwqPTvzqnbvWWAsQyORGV8qElUUWrTAh4='
WHERE
key_id = 'c963c6d2cc4d87a9eff24a16cd6c2193c930157941739540787fd718569326f2'
AND (
token = 'axJsP3g96FMwqPTvzqnbvWWAsQyORGV8qElUUWrTAh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)