UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hOFRns+ZTfX920TOXrOn/pIEvCQcRyDxbOB5hLY4L0U='
WHERE
key_id = '2bdc3f075897fe42f74e4e84c282403ff28448cd8418a2ad1208b11b57359e6f'
AND (
token = 'hOFRns+ZTfX920TOXrOn/pIEvCQcRyDxbOB5hLY4L0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)