UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dvc+iNt376VTVXX0HnSPkfpC1sRdQHsYKur/nddMHvc='
WHERE
key_id = 'a076dcd9f4166d26b9d5a82f11063c282fa966b23658b6faa6a350c8408f2279'
AND (
token = 'Dvc+iNt376VTVXX0HnSPkfpC1sRdQHsYKur/nddMHvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)