UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8+isPKdqDILbMnsIAexTDZ6L6CL4iSF0OzcAnWcRBVA='
WHERE
key_id = 'b9038b9efd0700e7b3f8341feaf141f54d1c210a854fb5f46fc7e08faa07a868'
AND (
token = '8+isPKdqDILbMnsIAexTDZ6L6CL4iSF0OzcAnWcRBVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)