UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0X0t+Ch0UsqfYCEjRCJIi323li2FbJQyvmlWY18/CtU='
WHERE
key_id = '4ba1ab99a2f3bfdac34d0c5409473047bba3d50b7fd504f377b251f94dd35b76'
AND (
token = '0X0t+Ch0UsqfYCEjRCJIi323li2FbJQyvmlWY18/CtU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)