UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6IK5WhIsFclxr0yJQ2PC2RJPeLqSob/p+uGVQOZJsl8='
WHERE
key_id = 'b6dfdb1f9b6b04667daf0e20d11707196c04f07131662bb3f0af33b538e7a710'
AND (
token = '6IK5WhIsFclxr0yJQ2PC2RJPeLqSob/p+uGVQOZJsl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)